The present invention generally relates to generating software documentation, and more particularly relates to systems to generate documentation that describe software elements and also provide examples of their use.
Source code developers often use functionalities provided by software libraries or other objects that are accessed through function calls or method invocations such as Application Program Interfaces (APIs). Generally, software libraries of other objects that provide functions have standard software interfaces that are described and otherwise explained in documentation packages. Documentation packages describe, for example, the operation of each software interface, any preparation that may be performed prior to accessing the software interface, and the structures used to access the software interface, including s input variables or structures and output variables or structures.
Software interface documentation often includes one or more examples of source code that invokes the software interface. Source code examples are often very helpful in quickly understanding how to effectively use a software interface. However, creation of source code examples, such as at a time when new software libraries or when new API versions are released, is sometimes time consuming. Generic source code examples, such as those that may be created by a software library developer, may not exhibit the most relevant aspects of the software interface with respect to the context being addressed by a particular software developer.
A software developer is also able to study source code in an existing project in an attempt to quickly determine how to best utilize a software interface. Although the source code in an existing project available to the software developer may be more relevant to the environment in which his or her software is being developed, the software developer may not have the experience with the software interface to realize whether a particular usage in the existing source code is typical and uses good coding practices, or if the usage is idiosyncratic or even problematic.